﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
using Xaye.Fred;

namespace Delphi.Isis.Fed {
    public class FredApi {
        private string _token;
        private static FredApi _fredApi;
        private static Fred _fred;

        private FredApi(string token) {
            _token = token;
            _fred = new Fred(_token); 
        }

        public static FredApi GetInstance(string token) {
            if(_fredApi == null) {
                _fredApi = new FredApi(token);
            }
            return _fredApi;
        }

        public void Test() {
            // GNPCA
            var t = _fred.GetSeries("GNPCA");
        }
    }
}
